package com.ledou44.apollolearn.config;

import com.ctrip.framework.apollo.spring.annotation.EnableApolloConfig;
import lombok.Data;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;

@Data
@Component
@EnableApolloConfig("datasource") //apollo配置的命名空间
public class DataSourceInfo {

    /**
     * 结合spring注入apollo配置信息 会实时自动刷新
     */
    @Value("${db.url}")
    private String dbUrl;

    @Value("${db.username}")
    private String dbUser;

    @Value("${db.password}")
    private String dbPass;

}
